<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
    $(function () {
        wx.config({
            debug: false,
            appId: "{$wx_config.appId}",
            timestamp: "{$wx_config.timestamp}",
            nonceStr: "{$wx_config.nonceStr}",
            signature: '{$wx_config.signature}',
            jsApiList: [
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'startRecord', //需要使用jssdk功能list
                'stopRecord',
                'onVoiceRecordEnd',
                'onVoicePlayEnd',
                'downloadVoice',
                'chooseWXPay'
            ]
        });

        wx.ready(function () {
            wx.onMenuShareTimeline({
                title: '{$sys_config.title}', // 
                desc: '{$sys_config.title}',
                link: '{$wx_config.url}', // 
                imgUrl: '{$sys_config.logo}', // 
                success: function () {

                },
                cancel: function () {
                    alert(window.location.href);
                    // 
                }
            });
            wx.onMenuShareAppMessage({
                title: '{$sys_config.title}', // 
                desc: '{$sys_config.title}',
                link: '{$wx_config.url}', // 
                imgUrl: '{$sys_config.logo}', // 
                type: 'link', // 
                success: function () {

                },
                cancel: function () {
                    // 
                }
            });
        });
    });

    function closeAlert(call_back) {
        //弹框关闭事件
        $('#display').click(function () {
            $('.alert').css('display', 'none');

            if (typeof (call_back) == 'function') {
                call_back();
            }
        });
        $('.alert').click(function () {
            $('.alert').css('display', 'none');

            if (typeof (call_back) == 'function') {
                call_back();
            }
        });
    }
</script>